/*
 * To change this license header, choose License Headers in Project Properties.
 * To change this template file, choose Tools | Templates
 * and open the template in the editor.
 */

package org.ArticleEditor.StartMenu;

import java.util.Collection;
import org.articleEditor.view.Styleable;
import org.openide.loaders.DataObject;
import org.openide.util.Lookup;
import org.openide.util.Utilities;

/**
 *
 * @author edil
 */
public class Font {
    
    DataObject Dobj;
    private Styleable styleable;
    private Lookup.Result<DataObject> result = null;
    private Lookup.Result<Styleable> resultStyle = null;
    
    public void getDoc()
    {
        result = Utilities.actionsGlobalContext().lookupResult(DataObject.class);
        resultStyle = Utilities.actionsGlobalContext().lookupResult(Styleable.class);
       // result.addLookupListener (this);
      //  resultStyle.addLookupListener(this);
        
        Collection<? extends DataObject> allEvents = result.allInstances();
        Collection<? extends Styleable> allEventsStyle = resultStyle.allInstances();
        if (!allEvents.isEmpty()) {
            DataObject event = allEvents.iterator().next();            
            Dobj = event;
                if(!allEventsStyle.isEmpty()){
                    styleable = allEventsStyle.iterator().next();
                }
            
        } 
    }
    
    public Styleable getStyleable()
    {
        return styleable;
    }
    
}
